/*
 * MainPanel.java
 *
 * Created on Nov 13, 2009, 1:08:41 PM
 */
package colors_flow;

import java.awt.Color;
import java.awt.Component;
import java.awt.Cursor;
import java.awt.Graphics;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Properties;
import javax.swing.Icon;
import javax.swing.JOptionPane;
import javax.swing.JRadioButton;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import sun.util.BuddhistCalendar;

/**
 *
 * @author thirdy
 */
public class MainPanel extends javax.swing.JPanel {

    /** Creates new form MainPanel */
    public MainPanel() {
        initComponents();
        setHandCursors();
        addCombinationAction();
        addOrginAction();
        enable2Tabs(false);
        loadUserDB();
    }

    // ========   Home Part  ==============
    private void showErrorAlert(String msg) {
        JOptionPane.showMessageDialog(Main.frame, msg, "A Problem Occurred...", JOptionPane.ERROR_MESSAGE);
    }
    // login, database using simple properties file,
    // see - http://www.exampledepot.com/egs/java.util/Props.html
    private Properties usersDB = new Properties();

    private void saveUserDB() {
        // save users
        try {
            usersDB.store(new FileOutputStream("users.properties"), null);
        } catch (IOException e) {
            e.printStackTrace();
            showErrorAlert(e.getMessage());
        }
    }

    private void loadUserDB() {
        // load users
        try {
            File f = new File("users.properties");
            boolean isNew = false;
            if (!f.exists()) {
                f.createNewFile();
                isNew = true;
            }
            usersDB.load(new FileInputStream("users.properties"));
            if (isNew) { // create default admin account
                usersDB.put("admin", "admin");
                saveUserDB();
            }
        } catch (IOException e) {
            e.printStackTrace();
            showErrorAlert(e.getMessage());
        }
    }

    private void createNewAccountAction() {
        String passwd = newPasswdTF.getText();
        String cpasswd = newPassConfTF.getText();
        String usernme = newUsernameTF.getText();
        String adminpss = newAdminPasswdTF.getText();
        // error trap
        if (usernme.isEmpty()) {
            showErrorAlert("Please enter a username");
            return;
        }
        if (passwd.isEmpty()) {
            showErrorAlert("Please enter a password");
            return;
        }
        if (cpasswd.isEmpty() || !cpasswd.equals(passwd)) {
            showErrorAlert("Passwords do not match");
            return;
        }
        if (adminpss.isEmpty() || !usersDB.get("admin").equals(adminpss)) {
            showErrorAlert("Please enter correct admin password");
            return;
        }
        if (usersDB.getProperty(usernme) != null) {
            showErrorAlert("Username '" + usernme + "' already in use");
            return;
        }
        // save accnt
        usersDB.put(usernme.trim(), passwd);
        saveUserDB();
        JOptionPane.showMessageDialog(Main.frame, "User '" + usernme + "' successfully created!");
        newAdminPasswdTF.setText("");
        newPassConfTF.setText("");
        newPasswdTF.setText("");
        newUsernameTF.setText("");
    }

    private void loginAction() {
        usersDB.list(System.out);
        String un = usernameTF.getText().trim();
        String pswd = new String(passwdTF.getPassword());
        String actualPswd = usersDB.getProperty(un);
        if (actualPswd != null && actualPswd.equals(pswd)) {
            enable2Tabs(true);
            mainTabPane.setSelectedIndex(1);
        } else {
            showErrorAlert("Sorry, invalid username/password");
        }
    }

    private void enable2Tabs(boolean b) {
        mainTabPane.setEnabledAt(1, b);
        mainTabPane.setEnabledAt(2, b);
    }
    // ========    Color Combination Part  ==============
    public static ColorCombinationPanel curCcp;
    public static ColorOriginPanel curCop;

    public ArrayList<ColorCombinationPanel> getCombinationPanels() {
        ArrayList a = new ArrayList<ColorCombinationPanel>();
        Component[] c = colorComContainer.getComponents();
        for (int i = 0; i < c.length; i++) {
            a.add((ColorCombinationPanel) c[i]);
        }
        return a;
    }

    public static void changeColorComPanel(ColorCombinationPanel ccp) {
        if (curCcp != null) {
            curCcp.setBackground(new Color(238, 238, 238));
        }
        ccp.setBackground(Color.WHITE);
        curCcp = ccp;
    }

    private void changeColor1Action(String hexColorStr) {
        System.out.println(hexColorStr);
        curCcp.setText1Temp(hexColorStr); // TODO: bug in Netbeans Matisse
        curCcp.setBackground1(MyColors.createColor(hexColorStr));
    }

    private void changeColor2Action(String hexColorStr) {
        System.out.println(hexColorStr);
        curCcp.setText2(hexColorStr);
        curCcp.setBackground2(MyColors.createColor(hexColorStr));
    }

    private void addCombinationAction() {
        ColorCombinationPanel ccp = new ColorCombinationPanel();
        colorComContainer.add(ccp);
        colorComContainer.validate();
        ccp.requestFocusInWindow();
        changeColorComPanel(ccp);
        ccp.scrollRectToVisible(new Rectangle(0, 0, 466, 223));
    }
    // ========    Color Orgin Part  ==============
    private ArrayList<String> colorComsStrList = new ArrayList<String>();

    private void colorOriginTabSelectedAction() {
        combinationsSelectionP.removeAll();
        combinationsSelectionP.validate();
        combinationsSelectionP.repaint();
        for (ColorCombinationPanel ccp : getCombinationPanels()) {
            if (ccp.combined) {
                final JRadioButton r = new JRadioButton(ccp.rStr);
                r.setIcon(getIconColor(ccp.rColor));
                r.setBorderPainted(true);
                r.addActionListener(new ActionListener() {

                    public void actionPerformed(ActionEvent e) {
                        changeColorOriginAction(r.getText());
                    }
                });
                colorComGroup.add(r);
                combinationsSelectionP.add(r);
                colorComsStrList.add(ccp.rStr);
            }
        }
    }

    public static void changeColorOrgnPanel(ColorOriginPanel cop) {
        System.out.println("CHANGE, DAPAT WHITE COLOR");
        if (curCop != null) {
            curCop.setBackground(new Color(238, 238, 238));
        }
        cop.setBackground(Color.WHITE);
        curCop = cop;
    }

    private void changeColorOriginAction(String hexColorStr) {
        if (curCop != null) {
            curCop.setIdx(colorComsStrList.indexOf(hexColorStr));
            curCop.setTextOrgn(hexColorStr);
            curCop.setBackgroundOrgn(MyColors.createColor(hexColorStr));
        }
    }

    private void addOrginAction() {
        ColorOriginPanel cop = new ColorOriginPanel(this);
        colorOrgnContainer.add(cop);
        colorOrgnContainer.validate();
        cop.requestFocusInWindow();
        changeColorOrgnPanel(cop);
        cop.scrollRectToVisible(new Rectangle(0, 0, 466, 223));
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        color1BGroup = new javax.swing.ButtonGroup();
        color2BGroup = new javax.swing.ButtonGroup();
        colorOrgGroup = new javax.swing.ButtonGroup();
        colorComGroup = new javax.swing.ButtonGroup();
        titlePanel = new javax.swing.JPanel();
        titleL = new javax.swing.JLabel();
        exitB = new javax.swing.JButton();
        maxB = new javax.swing.JButton();
        minB = new javax.swing.JButton();
        mainTabPane = new javax.swing.JTabbedPane();
        homeTab = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        jButton2 = new javax.swing.JButton();
        usernameTF = new javax.swing.JTextField();
        passwdTF = new javax.swing.JPasswordField();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        jLabel4 = new javax.swing.JLabel();
        newUsernameTF = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        newPasswdTF = new javax.swing.JPasswordField();
        newPassConfTF = new javax.swing.JPasswordField();
        newAdminPasswdTF = new javax.swing.JPasswordField();
        jButton3 = new javax.swing.JButton();
        colorComTab = new javax.swing.JPanel();
        resetB = new javax.swing.JButton();
        jPanel5 = new javax.swing.JPanel();
        jScrollPane4 = new javax.swing.JScrollPane();
        colorComContainer = new javax.swing.JPanel();
        jPanel8 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jPanel17 = new javax.swing.JPanel();
        jRadioButton17 = new javax.swing.JRadioButton();
        jRadioButton18 = new javax.swing.JRadioButton();
        jRadioButton19 = new javax.swing.JRadioButton();
        jRadioButton20 = new javax.swing.JRadioButton();
        jRadioButton21 = new javax.swing.JRadioButton();
        jRadioButton22 = new javax.swing.JRadioButton();
        jRadioButton3 = new javax.swing.JRadioButton();
        jRadioButton4 = new javax.swing.JRadioButton();
        jRadioButton35 = new javax.swing.JRadioButton();
        jRadioButton36 = new javax.swing.JRadioButton();
        jRadioButton37 = new javax.swing.JRadioButton();
        jRadioButton38 = new javax.swing.JRadioButton();
        jRadioButton39 = new javax.swing.JRadioButton();
        jRadioButton40 = new javax.swing.JRadioButton();
        jPanel15 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jPanel16 = new javax.swing.JPanel();
        jRadioButton11 = new javax.swing.JRadioButton();
        jRadioButton12 = new javax.swing.JRadioButton();
        jRadioButton13 = new javax.swing.JRadioButton();
        jRadioButton14 = new javax.swing.JRadioButton();
        jRadioButton15 = new javax.swing.JRadioButton();
        jRadioButton16 = new javax.swing.JRadioButton();
        jRadioButton29 = new javax.swing.JRadioButton();
        jRadioButton1 = new javax.swing.JRadioButton();
        jRadioButton2 = new javax.swing.JRadioButton();
        jRadioButton30 = new javax.swing.JRadioButton();
        jRadioButton31 = new javax.swing.JRadioButton();
        jRadioButton32 = new javax.swing.JRadioButton();
        jRadioButton33 = new javax.swing.JRadioButton();
        jRadioButton34 = new javax.swing.JRadioButton();
        jButton1 = new javax.swing.JButton();
        colorOrigTab = new javax.swing.JPanel();
        jPanel18 = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        jPanel19 = new javax.swing.JPanel();
        jRadioButton23 = new javax.swing.JRadioButton();
        jRadioButton24 = new javax.swing.JRadioButton();
        jRadioButton25 = new javax.swing.JRadioButton();
        jRadioButton26 = new javax.swing.JRadioButton();
        jRadioButton27 = new javax.swing.JRadioButton();
        jRadioButton28 = new javax.swing.JRadioButton();
        jRadioButton41 = new javax.swing.JRadioButton();
        jRadioButton42 = new javax.swing.JRadioButton();
        jRadioButton43 = new javax.swing.JRadioButton();
        jRadioButton44 = new javax.swing.JRadioButton();
        jRadioButton45 = new javax.swing.JRadioButton();
        jRadioButton46 = new javax.swing.JRadioButton();
        jRadioButton6 = new javax.swing.JRadioButton();
        jRadioButton5 = new javax.swing.JRadioButton();
        jPanel20 = new javax.swing.JPanel();
        jScrollPane5 = new javax.swing.JScrollPane();
        combinationsSelectionP = new javax.swing.JPanel();
        jPanel6 = new javax.swing.JPanel();
        jScrollPane6 = new javax.swing.JScrollPane();
        colorOrgnContainer = new javax.swing.JPanel();
        jButton4 = new javax.swing.JButton();
        resetB1 = new javax.swing.JButton();

        setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        setMaximumSize(new java.awt.Dimension(1000, 1000));

        titlePanel.setBackground(new java.awt.Color(0, 0, 0));

        titleL.setFont(new java.awt.Font("Impact", 0, 30));
        titleL.setForeground(new java.awt.Color(102, 102, 102));
        titleL.setText("<html><font color=\"FF0000\">My</font>  <font color=\"0000FF\">Palette</font>\n <font color=\"00FF00\">Mixer</font>\n\n</html>");

        exitB.setBackground(new java.awt.Color(0, 0, 0));
        exitB.setForeground(new java.awt.Color(255, 255, 255));
        exitB.setIcon(new javax.swing.ImageIcon(getClass().getResource("/res/exit.PNG"))); // NOI18N
        exitB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                exitBActionPerformed(evt);
            }
        });

        maxB.setBackground(new java.awt.Color(0, 0, 0));
        maxB.setIcon(new javax.swing.ImageIcon(getClass().getResource("/res/max.PNG"))); // NOI18N
        maxB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                maxBActionPerformed(evt);
            }
        });

        minB.setBackground(new java.awt.Color(0, 0, 0));
        minB.setIcon(new javax.swing.ImageIcon(getClass().getResource("/res/min.PNG"))); // NOI18N
        minB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                minBActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout titlePanelLayout = new javax.swing.GroupLayout(titlePanel);
        titlePanel.setLayout(titlePanelLayout);
        titlePanelLayout.setHorizontalGroup(
            titlePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, titlePanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(titleL)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 463, Short.MAX_VALUE)
                .addComponent(minB, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(maxB, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(exitB, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        titlePanelLayout.setVerticalGroup(
            titlePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(titlePanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(titlePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(titleL, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(minB, javax.swing.GroupLayout.DEFAULT_SIZE, 38, Short.MAX_VALUE)
                    .addComponent(maxB, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 38, Short.MAX_VALUE)
                    .addComponent(exitB, javax.swing.GroupLayout.DEFAULT_SIZE, 38, Short.MAX_VALUE))
                .addContainerGap())
        );

        mainTabPane.setFont(new java.awt.Font("Dialog", 1, 14));
        mainTabPane.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                mainTabPaneStateChanged(evt);
            }
        });

        jLabel5.setFont(new java.awt.Font("Dialog", 1, 14));
        jLabel5.setText("<html>\n<h1>Welcome!</h1>\n</html>");

        jPanel1.setBackground(new java.awt.Color(255, 255, 255));
        jPanel1.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 1, true));

        jLabel1.setText("<html>\n<h2>ABOUT The My Palette Mixer</h2>\n<br/>\n<p>\nIn computer graphics, a palette is either a given, finite set of colors for the management of digital images (that is, a color palette), or a small on-screen graphical element for choosing from a limited set of choices, not necessarily colors (such as a tools palette).\nDepending on the context (an engineer's technical specification, an advertisement, a programmers' guide, an image file specification, a user's manual, etc.) the term palette and related terms such as Web palette and RGB palette, for example, can have somewhat different meanings.\n</p>\n</html>");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 432, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 205, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(301, Short.MAX_VALUE))
        );

        jPanel2.setBackground(new java.awt.Color(0, 153, 204));
        jPanel2.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jPanel2.setForeground(new java.awt.Color(255, 255, 255));
        jPanel2.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                jPanel2KeyTyped(evt);
            }
        });

        jButton2.setMnemonic('L');
        jButton2.setText("Login");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        usernameTF.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                usernameTFKeyTyped(evt);
            }
        });

        passwdTF.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                usernameTFKeyTyped(evt);
            }
        });

        jLabel2.setBackground(new java.awt.Color(0, 0, 204));
        jLabel2.setForeground(new java.awt.Color(51, 0, 51));
        jLabel2.setText("Username:");

        jLabel3.setBackground(new java.awt.Color(0, 0, 204));
        jLabel3.setForeground(new java.awt.Color(51, 0, 51));
        jLabel3.setText("Password:");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(usernameTF, javax.swing.GroupLayout.DEFAULT_SIZE, 153, Short.MAX_VALUE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(passwdTF, javax.swing.GroupLayout.DEFAULT_SIZE, 154, Short.MAX_VALUE))
                    .addComponent(jButton2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(30, 30, 30)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(usernameTF, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(passwdTF, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel3))
                .addGap(18, 18, 18)
                .addComponent(jButton2)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel3.setBackground(javax.swing.UIManager.getDefaults().getColor("Button.focus"));
        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Create New Account"));

        jLabel4.setText("Username:");

        jLabel6.setText("Password:");

        jLabel7.setText("<html>Confirm<br/>Password:</html>");

        jLabel8.setText("<html>Admin<br/>Password:</html>");

        jButton3.setText("Create!");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(newUsernameTF, javax.swing.GroupLayout.DEFAULT_SIZE, 149, Short.MAX_VALUE))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel6)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(newPasswdTF, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel7)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(newPassConfTF, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel8)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(newAdminPasswdTF, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE))
                    .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(24, 24, 24)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(newUsernameTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel4))
                .addGap(18, 18, 18)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(newPasswdTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(newPassConfTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(23, 23, 23)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(newAdminPasswdTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel8))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 31, Short.MAX_VALUE)
                .addComponent(jButton3)
                .addContainerGap())
        );

        javax.swing.GroupLayout homeTabLayout = new javax.swing.GroupLayout(homeTab);
        homeTab.setLayout(homeTabLayout);
        homeTabLayout.setHorizontalGroup(
            homeTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(homeTabLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(homeTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(homeTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel5, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(148, 148, 148))
        );
        homeTabLayout.setVerticalGroup(
            homeTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(homeTabLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(homeTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(homeTabLayout.createSequentialGroup()
                        .addComponent(jLabel5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(28, 28, 28)
                        .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );

        mainTabPane.addTab("Home", homeTab);

        resetB.setText("Reset");
        resetB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                resetBActionPerformed(evt);
            }
        });

        jPanel5.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));

        jScrollPane4.setAutoscrolls(true);

        colorComContainer.setPreferredSize(new java.awt.Dimension(496, 2150));
        colorComContainer.setLayout(new java.awt.GridLayout(10, 1));
        jScrollPane4.setViewportView(colorComContainer);

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 529, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 446, Short.MAX_VALUE)
                .addContainerGap())
        );

        jPanel8.setBackground(new java.awt.Color(0, 0, 0));
        jPanel8.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Color 2 Selection", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 11), new java.awt.Color(255, 255, 255))); // NOI18N

        jPanel17.setLayout(new java.awt.GridLayout(14, 1));

        color2BGroup.add(jRadioButton17);
        jRadioButton17.setFont(jRadioButton17.getFont().deriveFont(jRadioButton17.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton17.getFont().getSize()-1));
        jRadioButton17.setForeground(new java.awt.Color(0, 0, 0));
        jRadioButton17.setText("#FFFF00");
        jRadioButton17.setBorderPainted(true);
        jRadioButton17.setIcon(getIconColor(Color.YELLOW));
        jRadioButton17.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor2Action(evt);
            }
        });
        jPanel17.add(jRadioButton17);

        color2BGroup.add(jRadioButton18);
        jRadioButton18.setFont(jRadioButton18.getFont().deriveFont(jRadioButton18.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton18.getFont().getSize()-1));
        jRadioButton18.setText("#7FFF00");
        jRadioButton18.setBorderPainted(true);
        jRadioButton18.setIcon(getIconColor(MyColors.YELLOW_GREEN));
        jRadioButton18.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor2Action(evt);
            }
        });
        jPanel17.add(jRadioButton18);

        color2BGroup.add(jRadioButton19);
        jRadioButton19.setFont(jRadioButton19.getFont().deriveFont(jRadioButton19.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton19.getFont().getSize()-1));
        jRadioButton19.setSelected(true);
        jRadioButton19.setText("#00FF00");
        jRadioButton19.setBorderPainted(true);
        jRadioButton19.setIcon(getIconColor(MyColors.GREEN));
        jRadioButton19.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor2Action(evt);
            }
        });
        jPanel17.add(jRadioButton19);

        color2BGroup.add(jRadioButton20);
        jRadioButton20.setFont(jRadioButton20.getFont().deriveFont(jRadioButton20.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton20.getFont().getSize()-1));
        jRadioButton20.setText("#00FFFF");
        jRadioButton20.setBorderPainted(true);
        jRadioButton20.setIcon(getIconColor(MyColors.BLUE_GREEN));
        jRadioButton20.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor2Action(evt);
            }
        });
        jPanel17.add(jRadioButton20);

        color2BGroup.add(jRadioButton21);
        jRadioButton21.setFont(jRadioButton21.getFont().deriveFont(jRadioButton21.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton21.getFont().getSize()-1));
        jRadioButton21.setText("#0000FF");
        jRadioButton21.setBorderPainted(true);
        jRadioButton21.setIcon(getIconColor(Color.BLUE));
        jRadioButton21.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor2Action(evt);
            }
        });
        jPanel17.add(jRadioButton21);

        color2BGroup.add(jRadioButton22);
        jRadioButton22.setFont(jRadioButton22.getFont().deriveFont(jRadioButton22.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton22.getFont().getSize()-1));
        jRadioButton22.setText("#8A2BE2");
        jRadioButton22.setBorderPainted(true);
        jRadioButton22.setIcon(getIconColor(MyColors.BLUE_VIOLET));
        jRadioButton22.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor2Action(evt);
            }
        });
        jPanel17.add(jRadioButton22);

        color2BGroup.add(jRadioButton3);
        jRadioButton3.setFont(jRadioButton3.getFont().deriveFont(jRadioButton3.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton3.getFont().getSize()-1));
        jRadioButton3.setText("#FFFFFF");
        jRadioButton3.setBorderPainted(true);
        jRadioButton3.setIcon(getIconColor(Color.WHITE));
        jRadioButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor2Action(evt);
            }
        });
        jPanel17.add(jRadioButton3);

        color2BGroup.add(jRadioButton4);
        jRadioButton4.setFont(jRadioButton4.getFont().deriveFont(jRadioButton4.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton4.getFont().getSize()-1));
        jRadioButton4.setText("#000000");
        jRadioButton4.setBorderPainted(true);
        jRadioButton4.setIcon(getIconColor(Color.BLACK));
        jRadioButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor2Action(evt);
            }
        });
        jPanel17.add(jRadioButton4);

        color2BGroup.add(jRadioButton35);
        jRadioButton35.setFont(jRadioButton35.getFont().deriveFont(jRadioButton35.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton35.getFont().getSize()-1));
        jRadioButton35.setForeground(new java.awt.Color(0, 0, 0));
        jRadioButton35.setText("#FF7F00");
        jRadioButton35.setBorderPainted(true);
        jRadioButton35.setIcon(getIconColor(MyColors.ORANGE));
        jRadioButton35.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor2Action(evt);
            }
        });
        jPanel17.add(jRadioButton35);

        color2BGroup.add(jRadioButton36);
        jRadioButton36.setFont(jRadioButton36.getFont().deriveFont(jRadioButton36.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton36.getFont().getSize()-1));
        jRadioButton36.setText("#FF0000");
        jRadioButton36.setBorderPainted(true);
        jRadioButton36.setIcon(getIconColor(MyColors.RED));
        jRadioButton36.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor2Action(evt);
            }
        });
        jPanel17.add(jRadioButton36);

        color2BGroup.add(jRadioButton37);
        jRadioButton37.setFont(jRadioButton37.getFont().deriveFont(jRadioButton37.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton37.getFont().getSize()-1));
        jRadioButton37.setText("#FF3F00");
        jRadioButton37.setBorderPainted(true);
        jRadioButton37.setIcon(getIconColor(MyColors.RED_ORANGE));
        jRadioButton37.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor2Action(evt);
            }
        });
        jPanel17.add(jRadioButton37);

        color2BGroup.add(jRadioButton38);
        jRadioButton38.setFont(jRadioButton38.getFont().deriveFont(jRadioButton38.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton38.getFont().getSize()-1));
        jRadioButton38.setText("#C71585");
        jRadioButton38.setBorderPainted(true);
        jRadioButton38.setIcon(getIconColor(MyColors.RED_VIOLET));
        jRadioButton38.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor2Action(evt);
            }
        });
        jPanel17.add(jRadioButton38);

        color2BGroup.add(jRadioButton39);
        jRadioButton39.setFont(jRadioButton39.getFont().deriveFont(jRadioButton39.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton39.getFont().getSize()-1));
        jRadioButton39.setText("#EE82EE");
        jRadioButton39.setBorderPainted(true);
        jRadioButton39.setIcon(getIconColor(MyColors.VIOLET));
        jRadioButton39.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor2Action(evt);
            }
        });
        jPanel17.add(jRadioButton39);

        color2BGroup.add(jRadioButton40);
        jRadioButton40.setFont(jRadioButton40.getFont().deriveFont(jRadioButton40.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton40.getFont().getSize()-1));
        jRadioButton40.setText("#FFE600");
        jRadioButton40.setBorderPainted(true);
        jRadioButton40.setIcon(getIconColor(MyColors.YELLOW_ORANGE));
        jRadioButton40.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor2Action(evt);
            }
        });
        jPanel17.add(jRadioButton40);

        jScrollPane2.setViewportView(jPanel17);

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 162, Short.MAX_VALUE)
                .addContainerGap())
        );

        jPanel15.setBackground(new java.awt.Color(0, 0, 0));
        jPanel15.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Color 1 Selection", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 11), new java.awt.Color(255, 255, 255))); // NOI18N

        jPanel16.setLayout(new java.awt.GridLayout(14, 1));

        color1BGroup.add(jRadioButton11);
        jRadioButton11.setFont(jRadioButton11.getFont().deriveFont(jRadioButton11.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton11.getFont().getSize()-1));
        jRadioButton11.setForeground(new java.awt.Color(0, 0, 0));
        jRadioButton11.setText("#FFFF00");
        jRadioButton11.setBorderPainted(true);
        jRadioButton11.setIcon(getIconColor(Color.YELLOW));
        jRadioButton11.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor1Action(evt);
            }
        });
        jPanel16.add(jRadioButton11);

        color1BGroup.add(jRadioButton12);
        jRadioButton12.setFont(jRadioButton12.getFont().deriveFont(jRadioButton12.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton12.getFont().getSize()-1));
        jRadioButton12.setText("#7FFF00");
        jRadioButton12.setBorderPainted(true);
        jRadioButton12.setIcon(getIconColor(MyColors.YELLOW_GREEN));
        jRadioButton12.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor1Action(evt);
            }
        });
        jPanel16.add(jRadioButton12);

        color1BGroup.add(jRadioButton13);
        jRadioButton13.setFont(jRadioButton13.getFont().deriveFont(jRadioButton13.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton13.getFont().getSize()-1));
        jRadioButton13.setText("#00FF00");
        jRadioButton13.setBorderPainted(true);
        jRadioButton13.setIcon(getIconColor(MyColors.GREEN));
        jRadioButton13.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor1Action(evt);
            }
        });
        jPanel16.add(jRadioButton13);

        color1BGroup.add(jRadioButton14);
        jRadioButton14.setFont(jRadioButton14.getFont().deriveFont(jRadioButton14.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton14.getFont().getSize()-1));
        jRadioButton14.setSelected(true);
        jRadioButton14.setText("#00FFFF");
        jRadioButton14.setBorderPainted(true);
        jRadioButton14.setIcon(getIconColor(MyColors.BLUE_GREEN));
        jRadioButton14.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor1Action(evt);
            }
        });
        jPanel16.add(jRadioButton14);

        color1BGroup.add(jRadioButton15);
        jRadioButton15.setFont(jRadioButton15.getFont().deriveFont(jRadioButton15.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton15.getFont().getSize()-1));
        jRadioButton15.setText("#0000FF");
        jRadioButton15.setBorderPainted(true);
        jRadioButton15.setIcon(getIconColor(Color.BLUE));
        jRadioButton15.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor1Action(evt);
            }
        });
        jPanel16.add(jRadioButton15);

        color1BGroup.add(jRadioButton16);
        jRadioButton16.setFont(jRadioButton16.getFont().deriveFont(jRadioButton16.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton16.getFont().getSize()-1));
        jRadioButton16.setText("#8A2BE2");
        jRadioButton16.setBorderPainted(true);
        jRadioButton16.setIcon(getIconColor(MyColors.BLUE_VIOLET));
        jRadioButton16.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor1Action(evt);
            }
        });
        jPanel16.add(jRadioButton16);

        color1BGroup.add(jRadioButton29);
        jRadioButton29.setFont(jRadioButton29.getFont().deriveFont(jRadioButton29.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton29.getFont().getSize()-1));
        jRadioButton29.setForeground(new java.awt.Color(0, 0, 0));
        jRadioButton29.setText("#FF7F00");
        jRadioButton29.setBorderPainted(true);
        jRadioButton29.setIcon(getIconColor(MyColors.ORANGE));
        jRadioButton29.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor1Action(evt);
            }
        });
        jPanel16.add(jRadioButton29);

        color1BGroup.add(jRadioButton1);
        jRadioButton1.setFont(jRadioButton1.getFont().deriveFont(jRadioButton1.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton1.getFont().getSize()-1));
        jRadioButton1.setText("#FFFFFF");
        jRadioButton1.setBorderPainted(true);
        jRadioButton1.setIcon(getIconColor(Color.WHITE));
        jRadioButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor1Action(evt);
            }
        });
        jPanel16.add(jRadioButton1);

        color1BGroup.add(jRadioButton2);
        jRadioButton2.setFont(jRadioButton2.getFont().deriveFont(jRadioButton2.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton2.getFont().getSize()-1));
        jRadioButton2.setText("#000000");
        jRadioButton2.setBorderPainted(true);
        jRadioButton2.setIcon(getIconColor(Color.BLACK));
        jRadioButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor1Action(evt);
            }
        });
        jPanel16.add(jRadioButton2);

        color1BGroup.add(jRadioButton30);
        jRadioButton30.setFont(jRadioButton30.getFont().deriveFont(jRadioButton30.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton30.getFont().getSize()-1));
        jRadioButton30.setText("#FF0000");
        jRadioButton30.setBorderPainted(true);
        jRadioButton30.setIcon(getIconColor(MyColors.RED));
        jRadioButton30.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor1Action(evt);
            }
        });
        jPanel16.add(jRadioButton30);

        color1BGroup.add(jRadioButton31);
        jRadioButton31.setFont(jRadioButton31.getFont().deriveFont(jRadioButton31.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton31.getFont().getSize()-1));
        jRadioButton31.setText("#FF3F00");
        jRadioButton31.setBorderPainted(true);
        jRadioButton31.setIcon(getIconColor(MyColors.RED_ORANGE));
        jRadioButton31.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor1Action(evt);
            }
        });
        jPanel16.add(jRadioButton31);

        color1BGroup.add(jRadioButton32);
        jRadioButton32.setFont(jRadioButton32.getFont().deriveFont(jRadioButton32.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton32.getFont().getSize()-1));
        jRadioButton32.setText("#C71585");
        jRadioButton32.setBorderPainted(true);
        jRadioButton32.setIcon(getIconColor(MyColors.RED_VIOLET));
        jRadioButton32.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor1Action(evt);
            }
        });
        jPanel16.add(jRadioButton32);

        color1BGroup.add(jRadioButton33);
        jRadioButton33.setFont(jRadioButton33.getFont().deriveFont(jRadioButton33.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton33.getFont().getSize()-1));
        jRadioButton33.setText("#EE82EE");
        jRadioButton33.setBorderPainted(true);
        jRadioButton33.setIcon(getIconColor(MyColors.VIOLET));
        jRadioButton33.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor1Action(evt);
            }
        });
        jPanel16.add(jRadioButton33);

        color1BGroup.add(jRadioButton34);
        jRadioButton34.setFont(jRadioButton34.getFont().deriveFont(jRadioButton34.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton34.getFont().getSize()-1));
        jRadioButton34.setText("#FFD700");
        jRadioButton34.setBorderPainted(true);
        jRadioButton34.setIcon(getIconColor(MyColors.YELLOW_ORANGE));
        jRadioButton34.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor1Action(evt);
            }
        });
        jPanel16.add(jRadioButton34);

        jScrollPane1.setViewportView(jPanel16);

        javax.swing.GroupLayout jPanel15Layout = new javax.swing.GroupLayout(jPanel15);
        jPanel15.setLayout(jPanel15Layout);
        jPanel15Layout.setHorizontalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel15Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel15Layout.setVerticalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel15Layout.createSequentialGroup()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 234, Short.MAX_VALUE)
                .addContainerGap())
        );

        jButton1.setText("Add Combination");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout colorComTabLayout = new javax.swing.GroupLayout(colorComTab);
        colorComTab.setLayout(colorComTabLayout);
        colorComTabLayout.setHorizontalGroup(
            colorComTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(colorComTabLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(colorComTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(colorComTabLayout.createSequentialGroup()
                        .addGroup(colorComTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jPanel15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, colorComTabLayout.createSequentialGroup()
                        .addComponent(jButton1)
                        .addGap(18, 18, 18)
                        .addComponent(resetB)))
                .addContainerGap())
        );
        colorComTabLayout.setVerticalGroup(
            colorComTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, colorComTabLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(colorComTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel5, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, colorComTabLayout.createSequentialGroup()
                        .addComponent(jPanel15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addGap(18, 18, 18)
                .addGroup(colorComTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(resetB)
                    .addComponent(jButton1))
                .addContainerGap())
        );

        mainTabPane.addTab("Color Combination", colorComTab);

        jPanel18.setBackground(new java.awt.Color(0, 0, 0));
        jPanel18.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Original Color Selection", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 11), new java.awt.Color(255, 255, 255))); // NOI18N

        jPanel19.setLayout(new java.awt.GridLayout(8, 1));

        colorOrgGroup.add(jRadioButton23);
        jRadioButton23.setFont(jRadioButton23.getFont().deriveFont(jRadioButton23.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton23.getFont().getSize()-1));
        jRadioButton23.setForeground(new java.awt.Color(0, 0, 0));
        jRadioButton23.setText("#FFFF00");
        jRadioButton23.setBorderPainted(true);
        jRadioButton23.setEnabled(false);
        jRadioButton23.setIcon(getIconColor(MyColors.YELLOW));
        jRadioButton23.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor1Origin(evt);
            }
        });
        jPanel19.add(jRadioButton23);

        colorOrgGroup.add(jRadioButton24);
        jRadioButton24.setFont(jRadioButton24.getFont().deriveFont(jRadioButton24.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton24.getFont().getSize()-1));
        jRadioButton24.setText("#7FFF00");
        jRadioButton24.setBorderPainted(true);
        jRadioButton24.setEnabled(false);
        jRadioButton24.setIcon(getIconColor(MyColors.YELLOW_GREEN));
        jRadioButton24.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor1Origin(evt);
            }
        });
        jPanel19.add(jRadioButton24);

        colorOrgGroup.add(jRadioButton25);
        jRadioButton25.setFont(jRadioButton25.getFont().deriveFont(jRadioButton25.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton25.getFont().getSize()-1));
        jRadioButton25.setText("#00FF00");
        jRadioButton25.setBorderPainted(true);
        jRadioButton25.setEnabled(false);
        jRadioButton25.setIcon(getIconColor(MyColors.GREEN));
        jRadioButton25.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor1Origin(evt);
            }
        });
        jPanel19.add(jRadioButton25);

        colorOrgGroup.add(jRadioButton26);
        jRadioButton26.setFont(jRadioButton26.getFont().deriveFont(jRadioButton26.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton26.getFont().getSize()-1));
        jRadioButton26.setText("#00FFFF");
        jRadioButton26.setBorderPainted(true);
        jRadioButton26.setEnabled(false);
        jRadioButton26.setIcon(getIconColor(MyColors.BLUE_GREEN));
        jRadioButton26.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor1Origin(evt);
            }
        });
        jPanel19.add(jRadioButton26);

        colorOrgGroup.add(jRadioButton27);
        jRadioButton27.setFont(jRadioButton27.getFont().deriveFont(jRadioButton27.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton27.getFont().getSize()-1));
        jRadioButton27.setText("#0000FF");
        jRadioButton27.setBorderPainted(true);
        jRadioButton27.setEnabled(false);
        jRadioButton27.setIcon(getIconColor(Color.BLUE));
        jRadioButton27.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor1Origin(evt);
            }
        });
        jPanel19.add(jRadioButton27);

        colorOrgGroup.add(jRadioButton28);
        jRadioButton28.setFont(jRadioButton28.getFont().deriveFont(jRadioButton28.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton28.getFont().getSize()-1));
        jRadioButton28.setText("#8A2BE2");
        jRadioButton28.setBorderPainted(true);
        jRadioButton28.setEnabled(false);
        jRadioButton28.setIcon(getIconColor(MyColors.BLUE_VIOLET));
        jRadioButton28.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor1Origin(evt);
            }
        });
        jPanel19.add(jRadioButton28);

        colorOrgGroup.add(jRadioButton41);
        jRadioButton41.setFont(jRadioButton41.getFont().deriveFont(jRadioButton41.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton41.getFont().getSize()-1));
        jRadioButton41.setForeground(new java.awt.Color(0, 0, 0));
        jRadioButton41.setText("#FF7F00");
        jRadioButton41.setBorderPainted(true);
        jRadioButton41.setEnabled(false);
        jRadioButton41.setIcon(getIconColor(MyColors.ORANGE));
        jRadioButton41.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor1Origin(evt);
            }
        });
        jPanel19.add(jRadioButton41);

        colorOrgGroup.add(jRadioButton42);
        jRadioButton42.setFont(jRadioButton42.getFont().deriveFont(jRadioButton42.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton42.getFont().getSize()-1));
        jRadioButton42.setText("#FF0000");
        jRadioButton42.setBorderPainted(true);
        jRadioButton42.setEnabled(false);
        jRadioButton42.setIcon(getIconColor(MyColors.RED));
        jRadioButton42.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor1Origin(evt);
            }
        });
        jPanel19.add(jRadioButton42);

        colorOrgGroup.add(jRadioButton43);
        jRadioButton43.setFont(jRadioButton43.getFont().deriveFont(jRadioButton43.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton43.getFont().getSize()-1));
        jRadioButton43.setText("#FF3F00");
        jRadioButton43.setBorderPainted(true);
        jRadioButton43.setEnabled(false);
        jRadioButton43.setIcon(getIconColor(MyColors.RED_ORANGE));
        jRadioButton43.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor1Origin(evt);
            }
        });
        jPanel19.add(jRadioButton43);

        colorOrgGroup.add(jRadioButton44);
        jRadioButton44.setFont(jRadioButton44.getFont().deriveFont(jRadioButton44.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton44.getFont().getSize()-1));
        jRadioButton44.setText("#C71585");
        jRadioButton44.setBorderPainted(true);
        jRadioButton44.setEnabled(false);
        jRadioButton44.setIcon(getIconColor(MyColors.RED_VIOLET));
        jRadioButton44.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor1Origin(evt);
            }
        });
        jPanel19.add(jRadioButton44);

        colorOrgGroup.add(jRadioButton45);
        jRadioButton45.setFont(jRadioButton45.getFont().deriveFont(jRadioButton45.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton45.getFont().getSize()-1));
        jRadioButton45.setText("#EE82EE");
        jRadioButton45.setBorderPainted(true);
        jRadioButton45.setEnabled(false);
        jRadioButton45.setIcon(getIconColor(MyColors.VIOLET));
        jRadioButton45.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor1Origin(evt);
            }
        });
        jPanel19.add(jRadioButton45);

        colorOrgGroup.add(jRadioButton46);
        jRadioButton46.setFont(jRadioButton46.getFont().deriveFont(jRadioButton46.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton46.getFont().getSize()-1));
        jRadioButton46.setText("#FFD700");
        jRadioButton46.setBorderPainted(true);
        jRadioButton46.setEnabled(false);
        jRadioButton46.setIcon(getIconColor(MyColors.YELLOW_ORANGE));
        jRadioButton46.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor1Origin(evt);
            }
        });
        jPanel19.add(jRadioButton46);

        colorOrgGroup.add(jRadioButton6);
        jRadioButton6.setFont(jRadioButton6.getFont().deriveFont(jRadioButton6.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton6.getFont().getSize()-1));
        jRadioButton6.setText("#000000");
        jRadioButton6.setBorderPainted(true);
        jRadioButton6.setEnabled(false);
        jRadioButton6.setIcon(getIconColor(Color.BLACK));
        jRadioButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor1Origin(evt);
            }
        });
        jPanel19.add(jRadioButton6);

        colorOrgGroup.add(jRadioButton5);
        jRadioButton5.setFont(jRadioButton5.getFont().deriveFont(jRadioButton5.getFont().getStyle() & ~java.awt.Font.BOLD, jRadioButton5.getFont().getSize()-1));
        jRadioButton5.setText("#FFFFFF");
        jRadioButton5.setBorderPainted(true);
        jRadioButton5.setEnabled(false);
        jRadioButton5.setIcon(getIconColor(Color.WHITE));
        jRadioButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changeColor1Origin(evt);
            }
        });
        jPanel19.add(jRadioButton5);

        jScrollPane3.setViewportView(jPanel19);

        javax.swing.GroupLayout jPanel18Layout = new javax.swing.GroupLayout(jPanel18);
        jPanel18.setLayout(jPanel18Layout);
        jPanel18Layout.setHorizontalGroup(
            jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel18Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 136, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel18Layout.setVerticalGroup(
            jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel18Layout.createSequentialGroup()
                .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 201, Short.MAX_VALUE)
                .addContainerGap())
        );

        jPanel20.setBackground(new java.awt.Color(204, 255, 0));
        jPanel20.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Combinations Made", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 11), new java.awt.Color(0, 0, 153))); // NOI18N

        combinationsSelectionP.setLayout(new java.awt.GridLayout(7, 2));
        jScrollPane5.setViewportView(combinationsSelectionP);

        javax.swing.GroupLayout jPanel20Layout = new javax.swing.GroupLayout(jPanel20);
        jPanel20.setLayout(jPanel20Layout);
        jPanel20Layout.setHorizontalGroup(
            jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel20Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 134, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel20Layout.setVerticalGroup(
            jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel20Layout.createSequentialGroup()
                .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 207, Short.MAX_VALUE)
                .addContainerGap())
        );

        jPanel6.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));

        jScrollPane6.setAutoscrolls(true);

        colorOrgnContainer.setPreferredSize(new java.awt.Dimension(496, 2150));
        colorOrgnContainer.setLayout(new java.awt.GridLayout(10, 1));
        jScrollPane6.setViewportView(colorOrgnContainer);

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 526, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 458, Short.MAX_VALUE)
                .addContainerGap())
        );

        jButton4.setText("Add Combination");
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        resetB1.setText("Reset");
        resetB1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                resetB1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout colorOrigTabLayout = new javax.swing.GroupLayout(colorOrigTab);
        colorOrigTab.setLayout(colorOrigTabLayout);
        colorOrigTabLayout.setHorizontalGroup(
            colorOrigTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(colorOrigTabLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(colorOrigTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jPanel18, 0, 168, Short.MAX_VALUE)
                    .addComponent(jPanel20, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(colorOrigTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(colorOrigTabLayout.createSequentialGroup()
                        .addComponent(jButton4)
                        .addGap(18, 18, 18)
                        .addComponent(resetB1))
                    .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        colorOrigTabLayout.setVerticalGroup(
            colorOrigTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(colorOrigTabLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(colorOrigTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(colorOrigTabLayout.createSequentialGroup()
                        .addComponent(jPanel20, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel18, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(colorOrigTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(resetB1)
                    .addComponent(jButton4))
                .addContainerGap())
        );

        mainTabPane.addTab("Color Origin", colorOrigTab);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(12, 12, 12)
                        .addComponent(mainTabPane, javax.swing.GroupLayout.PREFERRED_SIZE, 759, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(titlePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(titlePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(mainTabPane, javax.swing.GroupLayout.DEFAULT_SIZE, 575, Short.MAX_VALUE)
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    private void exitBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitBActionPerformed
        System.exit(0);
    }//GEN-LAST:event_exitBActionPerformed

    private void maxBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_maxBActionPerformed
        Main.max();
    }//GEN-LAST:event_maxBActionPerformed

    private void minBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_minBActionPerformed
        Main.min();
    }//GEN-LAST:event_minBActionPerformed

    private void changeColor2Action(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_changeColor2Action
        changeColor2Action(evt.getActionCommand());
    }//GEN-LAST:event_changeColor2Action

    private void changeColor1Action(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_changeColor1Action
        changeColor1Action(evt.getActionCommand());
    }//GEN-LAST:event_changeColor1Action

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        addCombinationAction();
    }//GEN-LAST:event_jButton1ActionPerformed

    private void changeColor1Origin(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_changeColor1Origin
        changeColorOriginAction(evt.getActionCommand());
    }//GEN-LAST:event_changeColor1Origin

    private void resetBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_resetBActionPerformed
        System.out.println("RESET in combination");
        colorComContainer.removeAll();
        colorComContainer.validate();
        colorComContainer.repaint();
    }//GEN-LAST:event_resetBActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        loginAction();
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        createNewAccountAction();
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        addOrginAction();
    }//GEN-LAST:event_jButton4ActionPerformed

    private void resetB1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_resetB1ActionPerformed
        System.out.println("RESET in orgin");
        colorOrgnContainer.removeAll();
        colorOrgnContainer.validate();
        colorOrgnContainer.repaint();
    }//GEN-LAST:event_resetB1ActionPerformed

    private void mainTabPaneStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_mainTabPaneStateChanged
        if (mainTabPane.getSelectedIndex() == 2) {
            colorOriginTabSelectedAction();
        }
    }//GEN-LAST:event_mainTabPaneStateChanged

    private void jPanel2KeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jPanel2KeyTyped
    }//GEN-LAST:event_jPanel2KeyTyped

    private void usernameTFKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_usernameTFKeyTyped
        System.out.println("KEY EVENT" + evt.getKeyChar());
        if(evt.getKeyChar() == KeyEvent.VK_ENTER) loginAction();
    }//GEN-LAST:event_usernameTFKeyTyped

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup color1BGroup;
    private javax.swing.ButtonGroup color2BGroup;
    private javax.swing.JPanel colorComContainer;
    private javax.swing.ButtonGroup colorComGroup;
    private javax.swing.JPanel colorComTab;
    private javax.swing.ButtonGroup colorOrgGroup;
    private javax.swing.JPanel colorOrgnContainer;
    private javax.swing.JPanel colorOrigTab;
    private javax.swing.JPanel combinationsSelectionP;
    private javax.swing.JButton exitB;
    private javax.swing.JPanel homeTab;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel15;
    private javax.swing.JPanel jPanel16;
    private javax.swing.JPanel jPanel17;
    private javax.swing.JPanel jPanel18;
    private javax.swing.JPanel jPanel19;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel20;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JRadioButton jRadioButton1;
    private javax.swing.JRadioButton jRadioButton11;
    private javax.swing.JRadioButton jRadioButton12;
    private javax.swing.JRadioButton jRadioButton13;
    private javax.swing.JRadioButton jRadioButton14;
    private javax.swing.JRadioButton jRadioButton15;
    private javax.swing.JRadioButton jRadioButton16;
    private javax.swing.JRadioButton jRadioButton17;
    private javax.swing.JRadioButton jRadioButton18;
    private javax.swing.JRadioButton jRadioButton19;
    private javax.swing.JRadioButton jRadioButton2;
    private javax.swing.JRadioButton jRadioButton20;
    private javax.swing.JRadioButton jRadioButton21;
    private javax.swing.JRadioButton jRadioButton22;
    private javax.swing.JRadioButton jRadioButton23;
    private javax.swing.JRadioButton jRadioButton24;
    private javax.swing.JRadioButton jRadioButton25;
    private javax.swing.JRadioButton jRadioButton26;
    private javax.swing.JRadioButton jRadioButton27;
    private javax.swing.JRadioButton jRadioButton28;
    private javax.swing.JRadioButton jRadioButton29;
    private javax.swing.JRadioButton jRadioButton3;
    private javax.swing.JRadioButton jRadioButton30;
    private javax.swing.JRadioButton jRadioButton31;
    private javax.swing.JRadioButton jRadioButton32;
    private javax.swing.JRadioButton jRadioButton33;
    private javax.swing.JRadioButton jRadioButton34;
    private javax.swing.JRadioButton jRadioButton35;
    private javax.swing.JRadioButton jRadioButton36;
    private javax.swing.JRadioButton jRadioButton37;
    private javax.swing.JRadioButton jRadioButton38;
    private javax.swing.JRadioButton jRadioButton39;
    private javax.swing.JRadioButton jRadioButton4;
    private javax.swing.JRadioButton jRadioButton40;
    private javax.swing.JRadioButton jRadioButton41;
    private javax.swing.JRadioButton jRadioButton42;
    private javax.swing.JRadioButton jRadioButton43;
    private javax.swing.JRadioButton jRadioButton44;
    private javax.swing.JRadioButton jRadioButton45;
    private javax.swing.JRadioButton jRadioButton46;
    private javax.swing.JRadioButton jRadioButton5;
    private javax.swing.JRadioButton jRadioButton6;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JTabbedPane mainTabPane;
    private javax.swing.JButton maxB;
    private javax.swing.JButton minB;
    private javax.swing.JPasswordField newAdminPasswdTF;
    private javax.swing.JPasswordField newPassConfTF;
    private javax.swing.JPasswordField newPasswdTF;
    private javax.swing.JTextField newUsernameTF;
    private javax.swing.JPasswordField passwdTF;
    private javax.swing.JButton resetB;
    private javax.swing.JButton resetB1;
    private javax.swing.JLabel titleL;
    private javax.swing.JPanel titlePanel;
    private javax.swing.JTextField usernameTF;
    // End of variables declaration//GEN-END:variables

    private Icon getIconColor(final Color color) {
        return new Icon() {

            public void paintIcon(Component c, Graphics g, int x, int y) {
                g.setColor(color);
                g.fillRect(x, y, 20, 20);
            }

            public int getIconWidth() {
                return 20;
            }

            public int getIconHeight() {
                return 20;
            }
        };
    }

    private void setHandCursors() {

        jRadioButton11.setCursor(new Cursor(Cursor.HAND_CURSOR));
        jRadioButton23.setCursor(new Cursor(Cursor.HAND_CURSOR));
        jRadioButton24.setCursor(new Cursor(Cursor.HAND_CURSOR));
        jRadioButton25.setCursor(new Cursor(Cursor.HAND_CURSOR));
        jRadioButton26.setCursor(new Cursor(Cursor.HAND_CURSOR));
        jRadioButton27.setCursor(new Cursor(Cursor.HAND_CURSOR));
        jRadioButton28.setCursor(new Cursor(Cursor.HAND_CURSOR));
        jRadioButton11.setCursor(new Cursor(Cursor.HAND_CURSOR));
        jRadioButton12.setCursor(new Cursor(Cursor.HAND_CURSOR));
        jRadioButton13.setCursor(new Cursor(Cursor.HAND_CURSOR));
        jRadioButton14.setCursor(new Cursor(Cursor.HAND_CURSOR));
        jRadioButton16.setCursor(new Cursor(Cursor.HAND_CURSOR));
        jRadioButton17.setCursor(new Cursor(Cursor.HAND_CURSOR));
        jRadioButton18.setCursor(new Cursor(Cursor.HAND_CURSOR));
        jRadioButton19.setCursor(new Cursor(Cursor.HAND_CURSOR));
        jRadioButton20.setCursor(new Cursor(Cursor.HAND_CURSOR));
        jRadioButton21.setCursor(new Cursor(Cursor.HAND_CURSOR));
        jRadioButton22.setCursor(new Cursor(Cursor.HAND_CURSOR));

    }
}
